﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>创建NetCoreWeb项目</title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css"/>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
	<h3>创建NetCoreWeb项目</h3>
    <b>1.安装NFinal.Web nuget包</b><br/>
    <b>2.配置Starup类</b><br />
	<pre class="brush: csharp">
        using Microsoft.AspNetCore.Builder;
        using Microsoft.AspNetCore.Hosting;
        using Microsoft.AspNetCore.Http;
        using Microsoft.Extensions.DependencyInjection;
        using Microsoft.Extensions.Logging;
        using Microsoft.Extensions.FileProviders;

        public class Startup
        {
            // This method gets called by the runtime. Use this method to add services to the container.
            // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
            public void ConfigureServices(IServiceCollection services)
            {
            }

            // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
            public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
            {
                app.UseMiddleware&lt;NFinal.Middleware.CoreMiddleware>();
                string root = System.IO.Directory.GetCurrentDirectory();
                app.UseStaticFiles(new StaticFileOptions()
                {
                    FileProvider = new PhysicalFileProvider(root),
                });
            }
        }
    </pre>
    <b>3.全局配置文件nfinal.json</b>
    <p>
        在该项目默认输出目录中创建nfinal.json。<br />
        一般位于bin\nfinal.json.
    </p>
    <b>4.插件配置文件plug.json</b>
    <p>
        该文件位于该项目输出目录中的Plugs目录下的插件目录中。<br />
        一般位于bin\Plugs\[插件目录]\plug.json<br />
        在该配置文件中需要指定dll插件的文件路径用于该项目加载.
    </p>
</body>
</html>
